]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
windowManager: Use one consistent animation mode for minimize/unminimize
authorDaniel van Vugt <daniel.van.vugt@canonical.com>
Thu, 16 Dec 2021 07:28:20 +0000 (15:28 +0800)
committerMarge Bot <marge-bot@gnome.org>
Wed, 22 Dec 2021 16:16:23 +0000 (16:16 +0000)
Firstly don't use EASE_IN for any minimize/unminimize animations because
those start slow and end fast. The effect of that was minimize/unminimize
appearing to be unresponsive to user clicks for a little while before
accelerating away. All such animations should be EASE_OUT for an immediate
response followed by deceleration at the end.

Secondly we replace the shallow 200ms QUADratic curves with a steeper
400ms EXPOnetial curve. Because it's steeper and twice as long the fast part
feels the same as 200ms QUAD, but there's an extra 200ms after that in which
to slow down smoothly giving a more fluid appearance. No sudden stops.

Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=786789
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2066>

js/ui/windowManager.js

index 50bfbab695f1a5e7432df99bffdaf5372b2c0589..784f7939350cc1e5974386b41850816a1c2aaea0 100644 (file)
@@ -21,7 +21,8 @@ const WorkspaceAnimation = imports.ui.workspaceAnimation;
 const { loadInterfaceXML } = imports.misc.fileUtils;
 
 var SHELL_KEYBINDINGS_SCHEMA = 'org.gnome.shell.keybindings';
-var MINIMIZE_WINDOW_ANIMATION_TIME = 200;
+var MINIMIZE_WINDOW_ANIMATION_TIME = 400;
+var MINIMIZE_WINDOW_ANIMATION_MODE = Clutter.AnimationMode.EASE_OUT_EXPO;
 var SHOW_WINDOW_ANIMATION_TIME = 150;
 var DIALOG_SHOW_WINDOW_ANIMATION_TIME = 100;
 var DESTROY_WINDOW_ANIMATION_TIME = 150;
@@ -1153,7 +1154,7 @@ var WindowManager = class {
             actor.ease({
                 opacity: 0,
                 duration: MINIMIZE_WINDOW_ANIMATION_TIME,
-                mode: Clutter.AnimationMode.EASE_OUT_QUAD,
+                mode: MINIMIZE_WINDOW_ANIMATION_MODE,
                 onStopped: () => this._minimizeWindowDone(shellwm, actor),
             });
         } else {
@@ -1184,7 +1185,7 @@ var WindowManager = class {
                 x: xDest,
                 y: yDest,
                 duration: MINIMIZE_WINDOW_ANIMATION_TIME,
-                mode: Clutter.AnimationMode.EASE_IN_EXPO,
+                mode: MINIMIZE_WINDOW_ANIMATION_MODE,
                 onStopped: () => this._minimizeWindowDone(shellwm, actor),
             });
         }
@@ -1218,7 +1219,7 @@ var WindowManager = class {
             actor.ease({
                 opacity: 255,
                 duration: MINIMIZE_WINDOW_ANIMATION_TIME,
-                mode: Clutter.AnimationMode.EASE_OUT_QUAD,
+                mode: MINIMIZE_WINDOW_ANIMATION_MODE,
                 onStopped: () => this._unminimizeWindowDone(shellwm, actor),
             });
         } else {
@@ -1250,7 +1251,7 @@ var WindowManager = class {
                 x: xDest,
                 y: yDest,
                 duration: MINIMIZE_WINDOW_ANIMATION_TIME,
-                mode: Clutter.AnimationMode.EASE_IN_EXPO,
+                mode: MINIMIZE_WINDOW_ANIMATION_MODE,
                 onStopped: () => this._unminimizeWindowDone(shellwm, actor),
             });
         }